import React from 'react';
import ReactDOM from 'react-dom';
import reportWebVitals from './reportWebVitals';
import { Route, createRoutesFromElements, createBrowserRouter, RouterProvider } from 'react-router-dom';
import { setVisitorId } from './utils/fingerprint';
import '@arco-design/web-react/dist/css/arco.css';
import './index.css';
import Search from './pages/search';
import Im from './pages/im';
import ImService  from './pages/im-service';

setVisitorId();

const router = createBrowserRouter(createRoutesFromElements(
    <Route path='/'>
      <Route path="/search" element={<Search />} />
      <Route path="/im/" element={<Im />} />
      <Route path="/im-service/" element={<ImService />} />
    </Route>
  )
);

ReactDOM.render(
  <React.StrictMode>
    <RouterProvider router={router} />
  </React.StrictMode>,
  document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
